package org.dromara.xxmj.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.core.domain.R;
import org.dromara.common.encrypt.annotation.ApiEncrypt;
import org.dromara.common.web.core.BaseController;
import org.dromara.system.service.ISysConfigService;
import org.dromara.xxmj.domain.model.XxmjRegisterBody;
import org.dromara.xxmj.service.XxmjRegisterService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 注册控制器
 *
 * @author Lion Li
 */
@Slf4j
@SaIgnore
@RequiredArgsConstructor
@RestController
@RequestMapping("/xxmj/register")
public class XxmjRegisterController extends BaseController {

    private final XxmjRegisterService registerService;

    /**
     * 用户注册
     */
    @SaIgnore
    @ApiEncrypt
    @PostMapping
    public R<Void> register(@Validated @RequestBody XxmjRegisterBody user) {
        registerService.register(user);
        return R.ok("注册成功");
    }


}
